//
// Created by tang on 2022/1/20.
//

#ifndef DIARYTOOL_APP_UTILS_HPP
#define DIARYTOOL_APP_UTILS_HPP

#include "config.h"

#include <functional>
#include <string>
#include <source_location>

using notify_cb = std::function<void()>;

DIARY_APP_SDK_API
void SendDebug(const std::string& msg, const std::source_location& loc = std::source_location::current());
DIARY_APP_SDK_API
void SendInfo(const std::string& msg, const std::source_location& loc = std::source_location::current());
DIARY_APP_SDK_API
void SendWarning(const std::string& msg, const std::source_location& loc = std::source_location::current());
DIARY_APP_SDK_API
void SendError(const std::string& msg, const std::source_location& loc = std::source_location::current());
DIARY_APP_SDK_API
void ShowProgressDialog(bool open = true);

DIARY_APP_SDK_API
void SendNotification(const std::string& text, double timeout_ms = 5000);
DIARY_APP_SDK_API
void SendNotificationEx(const std::string& text, double timeout_ms,
    std::string n1, notify_cb f1,
    std::string n2 = {}, notify_cb f2 = {},
    std::string n3 = {}, notify_cb f3 = {});

DIARY_APP_SDK_API
void ShowStatistics(const std::string &start, const std::string &end);

DIARY_APP_SDK_API
void CopyText(const std::string &text);

DIARY_APP_SDK_API
void CreateWorkItem(const std::string &date, const std::string &title, double hours);

DIARY_APP_SDK_API
void CreateWorkItemWithNote(const std::string &date, const std::string &title, double hours, const std::string &note);

#endif //DIARYTOOL_APP_UTILS_HPP
